package br.dcc.ufmg.persistence;

import java.sql.ResultSet;

import br.dcc.ufmg.domain.Class;

public class ClassesDAO extends ArtifactDAO<Class> {
	
	public String buildSqlArtifactsMeasures(String project, Class class_,
			String metric) {
		StringBuilder sqlBuilder = new StringBuilder(
				"SELECT metric_id, value FROM measure WHERE metric_id = '" + metric + "' ");
		sqlBuilder.append(" AND name = '").append(class_.getName())
				.append("' and source = '")
				.append(class_.getSource())
				.append("' and package = '")
				.append(class_.getPackage_().getName())
				.append("';");
		return sqlBuilder.toString();
	}

	@Override
	protected String getStringType() {
		// TODO Auto-generated method stub
		return "type";
	}

	@Override
	protected Class createArtifactFromResultSet(ResultSet rs) throws Exception {
		// TODO Auto-generated method stub
		return Class.createClass(rs);
	}
	

	
}
